﻿using System.Windows;
using System.Windows.Controls;
using XamlaApp.ViewModels;
using XamlaApp.Interfaces;

namespace XamlaApp.Views.ElementPropertyViews
{
    public partial class FrameworkElementProperties : UserControl
    {
        public FrameworkElementProperties()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //get the UI view model so we can access the canvas
            var mvm = Container.AppContainer.Resolve<MainUIViewModel>();

            switch (((Button)sender).Name)
            {
                case "btnBringForward":
                    mvm.StageView.BringForward(mvm.CurrentElement);
                    break;
                case "btnSendBackward":
                    mvm.StageView.SendBackward(mvm.CurrentElement);
                    break;
                case "btnSendToBack":
                    mvm.StageView.SendToBack(mvm.CurrentElement);
                    break;
                case "btnBringToFront":
                    mvm.StageView.BringToFront(mvm.CurrentElement);
                    break;

            }
        }
    }
}
